<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue 组件开发入门</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <p> Web 编程语言：</p>
    <languages></languages>
</div>
<script>
    Vue.component('languages', {
        data: function () {
            return {
                languages: ['PHP', 'JavaScript', 'Golang']
            }
        },
        template: '<ul><li v-for="language in languages">{{ language }}</li></ul>'
    })
    var app = new Vue({
        el: '#app',
    });
</script>
</body>
</html>